"""
URL configuration for mysite project.

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/5.1/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""

from django.contrib import admin  # 导入 Django 的 admin 模块
from django.urls import path  # 导入 path 以定义 URL 规则
from . import views  # 导入我们刚才创建的 views.py

# 定义 URL 路由规则
urlpatterns = [
    path("admin/", admin.site.urls),  # 访问 "/admin/" 时进入 Django 的后台管理页面
    path("", views.home, name="home"),  # 访问根路径 "/" 时，调用 views.home 视图函数
    path("about/", views.about, name="about"),
    path("contact/", views.contact, name="contact"), #联系

    #<str:username> 表示匹配任何字符串
    path("user/<str:username>/", views.user, name="user"),
    #年月
    path("time/<int:year>/<int:month>/", views.time, name="time")
]